﻿@model StackExchange.Opserver.Views.Exceptions.ExceptionsModel
@{
    var e = Model.Exception;
    var log = Model.SelectedLog;
    var exceptions = Model.Errors;

    this.SetPageTitle(Model.Title);
    this.SetMainTab(MainTab.Exceptions);
}
@section head {
    <script>
        $(function () { Status.Exceptions.init({ log: '@log', id: '@e.GUID', enablePreviews: @(Current.Settings.Exceptions.EnablePreviews ? "true" : "false"), showingDeleted: true }); });
    </script>
}
<div class="top-section error-bread-top">
    <div class="error-header">
        <a href="/exceptions">Exceptions</a> > <a href="/exceptions?log=@log.UrlEncode()">@e.ApplicationName</a> > <span class="error-title">@e.Message</span>
        @if (log.HasValue() && exceptions.Any(er => !er.IsProtected && !er.DeletionDate.HasValue) && Current.User.IsExceptionAdmin)
        {
        <span class="top-delete-link">(<a class="delete-link clear-all-link" href="/exceptions/delete-similar">Clear all visible</a>)</span>
        }
    </div>
</div>
<div class="bottom-section">
    @Html.Partial("Exceptions.Table", Model)
    <div class="no-content@(exceptions.Any() ? " hidden" : "")">No similar exceptions in @Model.SelectedLog</div>
    @if (log.HasValue() && exceptions.Any(er => !er.IsProtected && !er.DeletionDate.HasValue) && Current.User.IsExceptionAdmin)
    {
    <div class="clear-all-div">
        <a class="delete-link clear-all-link" href="/exceptions/delete-similar">&nbsp;X&nbsp;- Clear all visible errors</a>
    </div>
    }
</div>